package com.example

fun main() {

    val getyingyong = yingyong()
    println(getyingyong("沐浴露"))

}

//函数作为返回值类型,匿名函数就是lambda，lambda就是闭包
private fun yingyong() : (String)->String{
    val currentYear = "2027"
    val hour = (1..24).shuffled().last()
    return {goodsName:String ->
        "${currentYear}年，双十一${goodsName}促销倒计时: ${hour}小时"
    }
}